<%--
  Created by IntelliJ IDEA.
  User: Wonderming
  Date: 2018/4/16
  Time: 10:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<link type="text/css" rel="stylesheet" href="css/common/common.css"/>

<div class="animated fadeInRight">
     <div class="wrapper wrapper-content ng-scope">
          <div class="row">
              <div class="col-lg-12">
                   <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>{{ 'LIMIT' | translate }}</h5>
                        </div>

                        <div class="ibox-content sk-loading" ng-controller="riskLimitCtrl">
                            <div class="sk-spinner sk-spinner-wave">
                                <div class="sk-rect1"></div>
                                <div class="sk-rect2"></div>
                                <div class="sk-rect3"></div>
                                <div class="sk-rect4"></div>
                                <div class="sk-rect5"></div>
                            </div>

                            <form name="myform" serializer="searchLimit(data)">
                                 <div class="row">
                                     <!--类型-->
                                     <div class="col-sm-6 col-md-4 col-lg-1-5">
                                         <div class="form-group form-group-sm">
                                             <div class="input-group">
                                                 <span class="input-group-addon">类型：</span>
                                                 <select id="limit_type" name="limit_type" class="form-control" ng-model="limit.typeName">
                                                     <option value=""></option>
                                                     <option value="通用">通用</option>
                                                     <option value="收单机构">收单机构</option>
                                                     <option value="商户">商户</option>
                                                     <option value="域名">域名</option>
                                                 </select>
                                             </div>
                                         </div>
                                     </div>
                                     <!--名称-->
                                     <div class="col-sm-6 col-md-4 col-lg-1-5">
                                         <div class="form-group form-group-sm">
                                             <div class="input-group" ng-show="limit.typeName != '通用' && limit.typeName != '收单机构' && limit.typeName != '商户' && limit.typeName != '域名'">
                                                 <span class="input-group-addon">名称:</span>
                                                 <select class="form-control" ng-model="limit.refName">
                                                     <option value="">{{ Name }}</option>
                                                 </select>
                                             </div>
                                             <div class="input-group" ng-show="limit.typeName == '通用'">
                                                 <span class="input-group-addon">名称:</span>
                                                 <select class="form-control" ng-model="limit.refName">
                                                     <option value="">{{ Name }}</option>
                                                 </select>
                                             </div>
                                             <div class="input-group" ng-show="limit.typeName == '收单机构'">
                                                 <span class="input-group-addon">名称:</span>
                                                 <select class="form-control" ng-model="limit.refName" ng-options="x.name as x.name for x in init.acquirer">
                                                     <option value="">{{ Name }}</option>
                                                 </select>
                                             </div>
                                             <div class="input-group" ng-show="limit.typeName == '商户'">
                                                  <span class="input-group-addon">名称:</span>
                                                  <select class="form-control" ng-model="limit.refName" ng-options="x.name as x.id + '(' + x.name + ')' for x in init.merchant">
                                                      <option value="">{{ Name }}</option>
                                                  </select>
                                             </div>
                                             <div class="input-group" ng-show="limit.typeName == '域名'">
                                                 <span class="input-group-addon">名称：</span>
                                                 <select class="form-control" ng-model="limit.refName" ng-options="x.siteUrl as x.siteUrl for x in init.siteurl">
                                                     <option value="">{{ Name }}</option>
                                                 </select>
                                             </div>
                                         </div>
                                     </div>
                                     <!--限定类型-->
                                     <div class="col-sm-6 col-md-4 col-lg-1-5">
                                           <div class="form-group form-group-sm">
                                               <div class="input-group">
                                                   <span class="input-group-addon">限定类型：</span>
                                                   <select id="limitType" name="limitType" class="form-control" ng-model="limit.limitName">
                                                       <option value=""></option>
                                                       <option value="笔">每笔</option>
                                                       <option value="日">每日</option>
                                                       <option value="月">每月</option>
                                                       <option value="年">每年</option>
                                                   </select>
                                               </div>
                                           </div>
                                      </div>
                                     <!--状态-->
                                     <div class="col-sm-6 col-md-4 col-lg-1-5">
                                         <div class="form-group form-group-sm">
                                             <div class="input-group">
                                                 <span class="input-group-addon">状态：</span>
                                                 <select id="limit_status" name="limit_status" class="form-control" ng-model="limit.statusName " ng-options="x.name as x.name for x in statusConstant">
                                                 </select>
                                             </div>
                                         </div>
                                     </div>
                                     <!--创建人-->
                                     <div class="col-sm-6 col-md-4 col-lg-1-5">
                                         <div class="form-group form-group-sm">
                                             <div class="input-group">
                                                 <span class="input-group-addon">创建人：</span>
                                                 <input type="text" id="limit_founder" name="limit_founder" class="form-control" ng-model="limit.creator">
                                             </div>
                                         </div>
                                     </div>
                                     <!--最后修改人-->
                                     <div class="col-sm-6 col-md-4 col-lg-1-5">
                                         <div class="form-group form-group-sm">
                                             <div class="input-group">
                                                 <span class="input-group-addon">最后修改人：</span>
                                                 <input type="text" id="limit_modifier" name="limit_modifier" class="form-control" ng-model="limit.modifier">
                                             </div>
                                         </div>
                                     </div>
                                 </div>
                                 <div class="row">
                                     <div class="col-sm-6 col-md-6 col-lg-3 col-lg-offset-3">
                                         <button  type="submit" class="btn btn-sm btn-w-m btn-primary pull-right" ng-click="search(limit)">
                                             查询
                                         </button>
                                     </div>
                                     <div class="col-sm-6 col-md-6 col-lg-3">
                                         <button class="btn btn-sm btn-w-m btn-info" ng-click="resetForm()">
                                             重置
                                         </button>
                                     </div>
                                 </div>
                            </form>

                            <div class="hr-line-dashed"></div>

                            <button type="button" class="btn btn-sm btn-primary" ng-click="showModal(row,0)">新增</button>

                            <div class="table-responsive">
                                <table ng-table="limitTable" class="table table-condensed table-striped table-hover table-bordered">
                                    <tr ng-repeat="row in $data">
                                        <td class="text-center" style="line-height: 2" data-title="''">
                                            <input type="checkbox" id="constantCheckBoxID" ng-model="limitCheckBox" ng-click="collectSelectRows($event,row.id)"/>
                                        </td>
                                        <td class="text-center" style="line-height: 2" data-title="'名称'" >
                                             {{ row.refName }}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'类型'" >
                                            {{ row.typeName }}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'限定类型'" >
                                             {{ row.limitName}}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'限定卡'">
                                             {{row.paytypeName}}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'限定币种'" >
                                             {{ row.currency }}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'限定金额'" >
                                             {{ row.amount }}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'提醒值限定额的百分比'" >
                                             {{ row.warning }}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'状态'" >
                                              {{ row.statusName }}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'创建人'" >
                                             {{ row.creator }}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'创建时间'">
                                             {{ row.createTime | date: 'yyyy-MM-dd hh:mm:ss'}}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'最后修改人'">
                                             {{ row.modifier}}
                                        </td>

                                        <td class="text-center" style="line-height: 2" data-title="'修改时间'">
                                             {{ row.modifyTime | date: 'yyyy-MM-dd hh:mm:ss'}}
                                        </td>

                                        <td class="text-center" style="line-height: 2;max-width: 100px;" data-title="'操作'">
                                            <limitrisk-locked></limitrisk-locked>
                                        </td>

                                    </tr>
                                </table>
                            </div>
                            <my-pagination table-param="limitTable"></my-pagination>
                            <button class="btn btn-sm btn-primary del-btn marginTop-minus" ng-click="batchDel()" ng-disabled="deleteFlag">删除</button>
                        </div>
                   </div>
              </div>
          </div>
     </div>
</div>

